export function handleError(errors: any, defaultMessage: string): Array<string> {
    const errHead = '登录失败，错误信息为:';
    if (!errors || Object.keys(errors).length === 0) {
        return [errHead, defaultMessage];
    }
    const errList: string[] = [errHead];
    Object.keys(errors).forEach((key: string, index: number) => {
        errList.push(`错误${index + 1}: ${errors[key]}`);
    });

    return errList;
}
